import 'package:flutter/src/foundation/key.dart';
import 'package:flutter/src/widgets/framework.dart';

import 'package:flutter/material.dart';
class ScendPage extends StatefulWidget {
  const ScendPage({Key? key}) : super(key: key);

  @override
  State<ScendPage> createState() => _ScendPageState();
}

class _ScendPageState extends State<ScendPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("第二个页面"),
      ),
      body: Center(
        child: FlatButton(
            onPressed: (){
              // 触发方法返回上一页
              Navigator.of(context).pop();
            },
            child: Text("点击跳转第一页面 Navigator.of(context).pop() ")),
      ),
    );
    
  }
}